<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>代码监控</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="/layui/css/layui.css"  media="all">
    <!-- 注意：如果你直接复制所有代码到本地，上述css路径需要改成你本地的 -->
</head>
<body>


<table class="layui-hide" id="test"></table>


<script src="/layui/layui.js" charset="utf-8"></script>


<script>
    layui.use('table', function(){
        var table = layui.table;

        table.render({
            elem: '#test'
            ,url:'/data/students/'
            ,cellMinWidth: 80 //全局定义常规单元格的最小宽度，layui 2.2.1 新增
            ,cols: [[
                {field:'name', width:160, title: '名字', sort: true}
                ,{field:'email', width:160, title: '邮箱'}
                ,{field:'giteeUsername', width:160, title: 'gitee账户名', sort: true}
                ,{field:'totalCommitCount', width:160, title: '总提交次数'}
                ,{field:'dailyCommitCount', title: '当日提交次数', width: '30%', minWidth: 100} //minWidth：局部定义当前单元格的最小宽度，layui 2.2.1 新增
                ,{field:'lastCommit', title: '最后提交',templet: function(d){
                        return '<a href="'+ d.lastCommit +'">'+ d.lastCommit +'</a>'
                    }}
            ]]
        });
    });
</script>

</body>
</html>